<template>
	<view class="container">
		<!-- F1 轮播图开始 -->
		<view class="header">
			<swiper
			class="top-img indicators-dot" 
			autoplay 
			circular 
			interval='3000' 
			indicator-color="#D3D3D3" 
			indicator-active-color="#3E9CF9"
			indicator-dots
			>
			 <swiper-item class="swiperItem" v-for="(item,i) in swpierList" :key="i">
				<image style="width: 100%; height: 260rpx;"  :src="item">
			 </swiper-item>
			</swiper>
		</view>
		<!-- 轮播图结束 -->
		
		<!-- F2四块菜单图标 -->
		<view class="menuBox">
			<view class="menuItem" v-for="(item,i) in menuList" :key="i">
				<image :src="item.imgSrc"></image>
				<text>{{item.title}}</text>
			</view>
		</view>
		<!-- F2菜单区域结束 -->
		
		<!-- F3住宿停车区域开始 -->
		<view class="F3container">
			<!-- 左 -->
			<view class="parker">
				<text class="situation">xxxxxxx停车情况</text>
					<view class="parker_text">
						<text>空闲：</text>
						<text class="left_number">877</text>
						<image src="../../static/image/car.png"></image>
					</view>
				
			</view>
			<!-- 右 -->
			<view class="hotel">
				<text class="situation">xxx景区住宿情况</text>
				<view class="hotel_text">
					<text>空闲：</text>
					<text class="right_number">877</text>
					<image src="../../static/image/bad.png"></image>
				</view>
			</view>
		</view>
		<!-- F3住宿停车区域结束 -->
		
		<!-- F4 选项卡区域开始 -->
			<qc-switch-card 
			:current="current"
			:values="items" 
			@clickItem="_onclickSwitchCard" 
			styleType="text" 
			activeColor="#000000"/>
		<!-- 选项卡内容 -->
		<view class="listContainer">
			<!-- 选项1 -->
			<view v-show="current === 0">
					<!-- 选项1的内容 -->
							<text>这是选项1的内容</text>
					<view class="itemContainer">
						<view>
						<qc-list-card
							item_src="../../static/image/itemImg.png"
							item_title="特色名宿-ssss农家乐222222222222222222222222222222222222222"
							item_subtitle="机麻"
							item_subtitle_2="停车场"
							item_subtitle_3="游泳池"
							item_content="1987513545111111111111111111111111111111111111111111"
							item_content_2="青川县xxxxxxxxx"
							item_pid="2"
						></qc-list-card>
						</view>
						<view>
						<qc-list-card
							item_src="../../static/image/itemImg.png"
							item_title="xxxx农家乐"
							item_subtitle="麻将房"
							item_subtitle_2="232323"
							item_subtitle_3="网吧"
							item_content="1987513545"
							item_content_2="青川县xxxxxxxxx"
							item_pid="2"
						></qc-list-card>
						</view>
						<view>
						<qc-list-card
							item_src="../../static/image/itemImg.png"
							item_title="xxxx农家乐"
							item_subtitle="麻将房"
							item_subtitle_2="232323"
							item_subtitle_3="网吧"
							item_content="1987513545"
							item_content_2="青川县xxxxxxxxx"
							item_pid="2"
						></qc-list-card>
						</view>
						<view>
						<qc-list-card
							item_src="../../static/image/itemImg.png"
							item_title="xxxx农家乐"
							item_subtitle="麻将房"
							item_subtitle_2="232323"
							item_subtitle_3="网吧"
							item_pid="2"
						></qc-list-card>
						</view>
					</view>	
					
					
			</view>
			<!-- 选项2 -->
			<view v-show="current === 1">
					<!-- 选项2的内容 -->
					<text>这是选项2222222的内容</text>
			</view>
			<!-- 选项3 -->
			<view v-show="current === 2">
					<!-- 选项3的内容 -->
					<text>这是选项3333333的内容</text>
			</view>
			<!-- 选项4 -->
			<view v-show="current === 3">
					<!-- 选项4的内容 -->
					<text>这是选项4444444的内容</text>
			</view>
		</view>
		<view class="fix"></view>
		<!-- tabbar -->
		<wx-tabbar></wx-tabbar>
	</view>
</template>

<script>
	import wxTabbar from '@/components/wx-tabbar/wx-tabbar.vue'

	export default {
		data() {
			return {
				//保存的数据：
				data:{},
				//轮播图列表
				swpierList: [
						"../../static/home/Rectangle.png",
						"../../static/home/Rectangle.png",
						"../../static/home/Rectangle.png",
					],
				// 菜单按钮图列表
				// 菜单列表
				menuList:[
						{
							imgSrc:"../../static/image/cirlceOldTown.png",
							title:'古城导视'
						},
						{
							imgSrc:"../../static/image/circleStream.png",
							title:'景区直播'
						},
						{
							imgSrc:"../../static/image/circleInfo.png",
							title:'景区咨询'
						},
						{
							imgSrc:"../../static/image/circleAdvice.png",
							title:'投诉建议'
						}
				],
				
				// 选项卡
				current:0,
				items:['农家乐','本地美食','酒店','出行服务']
			}
			
		},
		onLoad() {
			//请求数据
			uni.request({
				method:'GET',
				url:'',
				success: (res) => {
					//查看请求的数据
					//console.log(res);
					//this.data = res.data.data
				},
				fail: (err) => {
					//查看报错
					//console.log(err);
				}
			})
		},
		components: {
			wxTabbar
		},
		onShow() {
			uni.hideTabBar()
		},
		methods: {
			// 选项卡点击事件
			_onclickSwitchCard(e){
				if(this.current!= e.currentIndex){
					this.current = e.currentIndex
				}
			}
		}
	}
</script>

<style lang="scss">
	page {
		background: $page-color-base;
	}

		//F1轮播图
		.header {
			padding: 32rpx;
			/deep/.top-img {
				position: relative;
				width: 100%;
				height: 130px;
				div{
					border-radius: 8px !important;
				}
				
			}
			/deep/.indicators-dot{
				.uni-swiper-dot{
					width: 5px !important;
					height: 5px !important;
				}
				.uni-swiper-dot-active{
					width: 5px !important;
					height: 5px !important;
				}
				/deep/.swiperItem{
					border-radius: 8px;
					text-align: center;
					image{
						height: 130px;
						width: 100%;
					}
				}
				
			}
		
			
		}
		
		//F2菜单样式
		.menuBox{
			display: flex;
			align-items: center;
			justify-content: space-around;
			// 菜单每一项样式
			.menuItem{
				padding: 5rpx;
				display: flex;
				flex-direction: column;
				align-items: center;
				// 菜单图标样式
				image{
				width: 80rpx;
				height: 80rpx;
				margin-bottom: 3rpx;
				}
				text{
					font-weight: 400;
				}
			}
		}
	
		//F3停车住宿样式		
		.F3container{
			display: flex;
			justify-content: space-around;
			padding: 18rpx;
			// 左
			.parker{
				background-image: url(../../static/image/leftBg.png);
				background-repeat: no-repeat;
				background-size: 100%;
				height: 144rpx;
				width: 330rpx;
				display: flex;
				flex-direction: column;
				justify-content: space-around;
				overflow: hidden;
				//左 文字
				.parker_text{
					color: #FFFFFF;
					display: flex;
					justify-content: space-around;
					align-items: center;
				}
			}
			
			// 右
			.hotel{
				background-image: url(../../static/image/rightBg.png);
				background-repeat: no-repeat;
				background-size: 100%;
				height: 144rpx;
				width: 330rpx;
				display: flex;
				flex-direction: column;
				justify-content: space-around;
				overflow: hidden;
				//右文字
				.hotel_text{
					color: #FFFFFF;
					display: flex;
					justify-content: space-around;
					align-items: center;
				}
			}
			
			// 左&右 图片
			image{
				width: 56rpx;
				height: 56rpx;
			}
			// 情况文字样式
			.situation{
				color: #FFFFFF;
				text-align: center;
			}
			// 空位数字样式
			.left_number{
				color: #FFFFFF;
				text-align: center;
				width: 110rpx;
				padding: 10rpx;
				background-color: rgb(253,189,81);
				border-radius: 24px;
				margin-bottom: 5rpx;
			}
			.right_number{
				color: #FFFFFF;
				text-align: center;
				width: 110rpx;
				padding: 10rpx;
				background-color: rgb(30,212,125);
				border-radius: 24px;
				margin-bottom: 5rpx;
			}
		}
		// F4选项卡服务内容样式
		.listContainer{
			
			.itemContainer{
				display: flex;
				justify-content: space-around; 
				flex-wrap: wrap;
				margin-bottom: 40rpx;
				}
		}
		//垫高tabbar
		.fix{
			height: 80rpx;
			
		}
			
		
</style>
